/*************************************
 * Created by WebStorm
 * Author : 艾尼亚尔·毛拉吾提
 * QQ : 524155792  WeChat : ainiyar0124
 * Created Time :2024/2/6 13:27
 Desc :
 **************************************/

import type {PropType} from 'vue';
import {NDataTable} from 'naive-ui';
import {DataTableColumn} from 'naive-ui'
import {propTypes} from '@/libs/propTypes.ts';

export const customProps = {
    ...NDataTable.props, // 这里继承原 UI 组件的 props
    //以下自定义props
    titles: {
        type: String,
        default: null,
    },
    titleTooltip: {
        type: String,
        default: null,
    },
    size: {
        type: String,
        default: 'small',
    },
    actionColumn: {
        type: Object as PropType<DataTableColumn>,
        default: null,
    },
    emptyText: {
        type: String,
        default: '暂无相关数据',
    },
    pagination: {
        type: [Object as PropType<{
            pageSize?: number;
            pageSizes?: number[];
        }>, Boolean],
        default: () => {
        },
    },
    methods:{
        type: String,
        default: "GET",
    },
    params:{
        type: [Object as PropType<string|any>],
        default: () => {},
    },
    listUrl:{
        type: String,
        default: null,
    },
    request: {
        type: [Object, String, Function] as PropType<(...arg: any) => Promise<any>>,
        default: null,
    },
    //是显示选择框
    defaultSelection: {
        type: Boolean,
        default: false,
    },
    //是否默认显示序号
    defaultSerialNumber: {
        type: Boolean,
        default: false,
    },
    //序号标题
    serialNumberTitle: {
        type: String,
        default: "No.",
    },
    canResize: propTypes.bool.def(true),
    resizeHeightOffset: propTypes.number.def(0),
}